
cd "C:\Users\wie-dainn\Dropbox\Work\BIHS\Replication.Package"

*BIHS
clear
use "Data\survival_CM.dta", clear

areg married_survival precipA_90Ndays i.birthyear i.mage i.div if female == 1 [pweight=popweight], absorb(gridcell) vce(cluster gridcell)
outreg2 using "Tables\Table2.doc", replace label keep(precipA_90Ndays)  title(The Impacts of Extreme Rainfall on Child Marriage: Women) addtext(Birth Year FE, Yes, Age FE, Yes, Cell FE, Yes, Division FE, Yes) dec(3)
g coef_1 = _b[precipA_90Ndays]
sum precipA_90Ndays if e(sample)
g coef_1std = coef_1 * r(sd)
sum married_survival if e(sample)
g mean_1 = r(mean)

areg married_survival precipA_85Ndays i.birthyear i.mage i.div if female == 1 [pweight=popweight], absorb(gridcell) vce(cluster gridcell)
outreg2 using "Tables\Table2.doc", append label keep(precipA_85Ndays)  title(The Impacts of Extreme Rainfall on Child Marriage: Women) addtext(Birth Year FE, Yes, Age FE, Yes, Cell FE, Yes, Division FE, Yes) dec(3)
g coef_2 = _b[precipA_85Ndays]
sum precipA_85Ndays if e(sample)
g coef_2std = coef_2 * r(sd)
sum married_survival if e(sample)
g mean_2 = r(mean)

areg married_survival precipA_75Ndays i.birthyear i.mage  i.div if female == 1 [pweight=popweight], absorb(gridcell) vce(cluster gridcell)
outreg2 using "Tables\Table2.doc", append label keep(precipA_75Ndays)  title(The Impacts of Extreme Rainfall on Child Marriage: Women) addtext(Birth Year FE, Yes, Age FE, Yes, Cell FE, Yes, Division FE, Yes) dec(3)
g coef_3 = _b[precipA_75Ndays]
sum precipA_75Ndays if e(sample)
g coef_3std = coef_3 * r(sd)
sum married_survival if e(sample)
g mean_3 = r(mean)

sum coef_1std coef_2std coef_3std 
sum mean_*

*BIHS special module
clear
use "Data\survival_CBS4.dta", clear


areg married_survival precipA_90Ndays i.birthyear i.cmage i.div if female == 1 [pweight=popweight], absorb(gridcell) vce(cluster gridcell)
outreg2 using "Tables\Table2.doc", append label keep(precipA_90Ndays)  title(The Impacts of Extreme Rainfall on Child Marriage: Women) addtext(Birth Year FE, Yes, Age FE, Yes, Cell FE, Yes, Division FE, Yes) dec(3)
g coef_4 = _b[precipA_90Ndays]
sum precipA_90Ndays if e(sample)
g coef_4std = coef_4 * r(sd)
sum married_survival if e(sample)
g mean_4 = r(mean)

areg married_survival precipA_85Ndays i.birthyear i.cmage i.div if female == 1 [pweight=popweight], absorb(gridcell) vce(cluster gridcell)
outreg2 using "Tables\Table2.doc", append label keep(precipA_85Ndays)  title(The Impacts of Extreme Rainfall on Child Marriage: Women) addtext(Birth Year FE, Yes, Age FE, Yes, Cell FE, Yes, Division FE, Yes) dec(3)
g coef_5 = _b[precipA_85Ndays]
sum precipA_85Ndays if e(sample)
g coef_5std = coef_5 * r(sd)
sum married_survival if e(sample)
g mean_5 = r(mean)

areg married_survival precipA_75Ndays i.birthyear i.cmage  i.div if female == 1 [pweight=popweight], absorb(gridcell) vce(cluster gridcell)
outreg2 using "Tables\Table2.doc", append label keep(precipA_75Ndays)  title(The Impacts of Extreme Rainfall on Child Marriage: Women) addtext(Birth Year FE, Yes, Age FE, Yes, Cell FE, Yes, Division FE, Yes) dec(3)
g coef_6 = _b[precipA_75Ndays]
sum precipA_75Ndays if e(sample)
g coef_6std = coef_6 * r(sd)
sum married_survival if e(sample)
g mean_6 = r(mean)



sum coef_4std coef_5std coef_6std
sum mean_*